package zju.dgm.service.dataservice;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import zju.dgm.dto.DFFilter;
import zju.dgm.dto.DataFrame;

import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.locks.Condition;
import java.util.function.Function;

/**
 * @author lzy
 */
@Getter
@Setter
public class Subscriber {

    int counter;
    DataFrame df = null;
    DFFilter filter;
    final Object lock = new Object();

    Subscriber(int counter,DFFilter filter) {
        this.counter = counter;
        this.filter=filter;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Subscriber that = (Subscriber) o;
        return counter == that.counter;
    }

    @Override
    public int hashCode() {
        return Objects.hash(counter);
    }
}
